<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../css/index.css" />
		<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/vant.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/ajax.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/xback.js" type="text/javascript" charset="utf-8"></script>
		<script src="html5plus://ready"></script>
		<title></title>
		<style type="text/css">
			body{
				background-color: #E5E5E5;
			}
			#img{
				width: 70px;
				height: 70px;
				margin-top: 30px;
				margin-left: 15px;
				border-radius: 35px;
			}
			#name {
				margin-top: 40px;
				margin-left: 40px;
				color: white;
				font-size: 18px;
			}
			#header{
				background-color: red;
				height: 120px;
			}
			#icon{
				background-color: white;
				margin-bottom: 10px;
				height: 70px;
				line-height: 95px;
				text-align: center;
				border-radius: 20px;
			}
			#icons{
				position: relative;
				top:-8px
			}
			.icon{
				font-size: 25px;
			}
			.icon-text{
				font-size: 15px;
			}
			
		</style>
	</head>
	<body>
		<div id="app">
			<van-row id="header">
				<van-col span="24">
					<van-col span="4">
						<span>
				 			<img v-bind:src="url" @click="User()"  id="img" onerror="javascript:this.src='../img/insert.png';"/>
					    </span>
					</van-col>
					<van-col span="6" id="name">
						<span @click="User(0)">
							{{name}}
						</span>
					</van-col>
				</van-col>
			</van-row>
			<van-row id="icons">
				<van-col offset="1" span="22" id="icon">
					<van-col span="4" offset="1">
						<div @click="User(1)">
							<van-icon name="shopping-cart-o" class="icon"/>
							<div class="icon-text">
								待付款
							</div>	
						</div>		 
					</van-col>
					<van-col span="4" offset="1">
						<div  @click="User(2)">
							<van-icon name="records" class="icon"/>
							<div class="icon-text">
								待收货
							</div>		
						</div>
									 
					</van-col>
					<van-col span="4" offset="1">
						<div  @click="User(3)">
							<van-icon name="chat-o" class="icon"/>
							<div class="icon-text">
								待评论
							</div>		
						</div>	 
					</van-col>
					<van-col offset="1" span="1">
						<div style="float:left;	width: 3px;height:70px;background-color: #E5E5E5;"></div><!-- 画竖线 -->
					</van-col>
					<van-col span="5" >
						<div  @click="User(4)">
							<van-icon name="orders-o" class="icon"/>
							<div class="icon-text">
								我的订单
							</div>		
						</div>
									 
					</van-col>
				</van-col>
			</van-row>
			<van-row>
				<van-col span="24" >
					<van-cell title="个人资料" icon="manager-o" is-link  size="large" @click="User(5)"/>
				</van-col>
				<van-col span="24" >
					<van-cell title="收货地址" icon="location-o" size="large" is-link  @click="User(6)"/>
				</van-col>
				<van-col span="24" >
					<van-cell title="我的收藏" icon="like-o" size="large" is-link @click="User(7)"/>
				</van-col>
				<van-col span="24" style="margin-top: 15px;">
					<van-cell title="设置" icon="setting-o" size="large" is-link  @click="User(8)"/>
				</van-col>
			</van-row>
		</div>
		<script type="text/javascript">
			var app = new Vue({
				el: "#app",
				data: {
					name:"",
					url:"../img/insert.png",
				},
				mounted(){
					var _this=this;
					
					if(localStorage.getItem("name")!=null){
						_this.name=localStorage.getItem("name");
						_this.url=localStorage.getItem("imgUrl");
					}
				},
				methods:{
					User:function(n){
						var _this=this;
						// console.log(n);
						if(localStorage.getItem("keys")==null){
							_this.$dialog.confirm({
							  title: '提示',
							  message: '还未登陆，是否去登陆',
							  confirmButtonText:"登陆"
							}).then(() => {
							  // on confirm
							  plus.webview.create("../views/Person-views/login.html","login");
							  plus.webview.show("login");
							}).catch(() => {
							  // on cancel
							 
							});
						}else{
							switch(n){
								case 1:
									plus.webview.create("../views/Person-views/waitpay.html","waitpay");//待付款页面
									plus.webview.show("waitpay");
								break;
								case 4:
									plus.webview.create("../views/Person-views/MyOrder.html","MyOrder");//个人资料页面
									plus.webview.show("MyOrder");
								break;
								case 5:
									plus.webview.create("../views/Person-views/personal _data.html","personal _data");//个人资料页面
									plus.webview.show("personal _data");
								break;
								case 6:
									plus.webview.create("../views/Shopping_view/Myaddress.html","Myaddress");//个人资料页面
									plus.webview.show("Myaddress");
								break;
								case 7:
									plus.webview.create("../views/Person-views/MyCollected.html","MyCollected");//个人资料页面
									plus.webview.show("MyCollected");
								break;
								case 8:
									plus.webview.create("../views/Person-views/Install.html","Install");//设置页面
									plus.webview.show("Install");
								break;
								default:
								break;
							}
						}
					}
				},
			});
		</script>
	</body>
</html>